/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package routing;

import java.io.Serializable;

/**
 * An abstraction of routing and target nodes
 * @author artem, Arvanitis Ioannis
 */
public class RouteNodeAbstraction implements Serializable{
    private int nodeId;
    private boolean target;
    private RouteNodeList forwardNodeList;

    /**
     * Abstraction of a node within a node route.
     * @param nodeId The id of the represented node
     * @param target Whether or not this node is a target
     * @param forwardNodeList ArrayList represending the nodes the node needs to send the message to, upon receiving it.
     *   If null, there is no routing information
     */
    public RouteNodeAbstraction(int nodeId, boolean target, RouteNodeList forwardNodeList){
        this.nodeId = nodeId;
        this.target = target;
        this.forwardNodeList = forwardNodeList;
    }

    /**
     * Gets the node's id
     * @return the nodeId
     */
    public int getNodeId() {
        return nodeId;
    }

    /**
     * Sets the node's id
     * @param nodeId The nodeId to set
     */
    public void setNodeId(int nodeId) {
        this.nodeId = nodeId;
    }

    /**
     * Determines if this node is a terget node
     * @return if this node is a terget node
     */
    public boolean isTarget() {
        return target;
    }

    /**
     * Sets if this node is a terget node
     * @param target If this node is a terget node
     */
    public void setTarget(boolean target) {
        this.target = target;
    }

    /**
     * Gets the nodelist to forward to
     * @return the forwardNodeList
     */
    public RouteNodeList getForwardNodeList() {
        return forwardNodeList;
    }

    /**
     * Sets the nodelist to forward to
     * @param forwardNodeList The forwardNodeList to set
     */
    public void setForwardNodeList(RouteNodeList nodeList) {
        this.forwardNodeList = nodeList;
    }

}
